package ru.jexp.poi.model.free;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

public class SimpleRange
{
    private Map<String,ICell> name2fields = new HashMap<String,ICell>();

    public SimpleRange(ICell[] fields)
    {
        super();
        for (int i = 0; i < fields.length; i++)
        {
            ICell field = fields[i];
            name2fields.put(field.getName(), field);
        }
    }

    public boolean containtsName(String name)
    {
        return name2fields.containsKey(name);
    }

    public ICell getField(String name)
    {
        return (ICell) name2fields.get(name);
    }

    public Collection<String> getNames()
    {
    	return name2fields.keySet();
    }
}
